package com.softeem.dao.impl;

import com.softeem.dao.CourseDao;
import com.softeem.entity.Course;
import com.softeem.entity.Student;
import com.softeem.utils.BaseDao;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.sql.SQLException;
import java.util.List;

public class CourseDaoImpl implements CourseDao {
    private QueryRunner qr = new QueryRunner(BaseDao.getDs());
    @Override
    public List<Course> findCourse() throws SQLException {
        String sql = "select * from course limit 0,5";
        return qr.query(sql,new BeanListHandler<>(Course.class));
    }
}
